package com.example.universitylibraryback.entity;

import lombok.Data;
import java.time.LocalDate;

@Data
public class BorrowRequest {
    private String requestId;
    private String readerId;
    private String bookIsbn;
    private LocalDate requestDate;
    private Integer borrowDays; // 请求借阅天数
    private Integer currentBorrowCount; // 当前已借书数量
    private Boolean hasOverdueRecords; // 是否有逾期记录
    private String readerType; // 读者类型
    private String rejectionReason; // 拒绝原因
    private Boolean approved; // 是否批准
    private Integer actualBorrowDays; // 实际批准的借阅天数
    
    // 规则执行结果
    public void approve(int actualDays) {
        this.approved = true;
        this.actualBorrowDays = actualDays;
    }
    
    public void reject(String reason) {
        this.approved = false;
        this.rejectionReason = reason;
    }
}